<!-- 知识列表  -->
<div id="zhishilist">
	<div>
		<% for zhishi in @zhishis %>
		<div class="node">
			<div class="head">
				<span class="title"><%= link_to zhishi.title, zhishi %></span>
				<!-- 
					<%= link_to image_tag("tb_bianji.png", :alt => "编辑"),edit_zhishi_path(zhishi) %>
					<%= link_to image_tag("tb_sancu.png", :alt => "删除"), zhishi, :confirm => '你确定要删除吗?', :method => :delete %> 
				-->
				
				<span class="headext">
				<% if is_logged_in? and logged_in_user==zhishi.username %>
					<%= link_to "编辑",edit_zhishi_path(zhishi) %>
					<%= link_to "删除",zhishi, :confirm => '你确定要删除吗?', :method => :delete %>				
				<% end %>
				</span>
				<% if zhishi.tags? %>
					<span class="tags">标签:<%= zhishi.tags %></span>
				<% end %>
			</div>
			<div class="body"><%= zhishi.content %></div>
			<div class="foot">
				<%= link_to zhishi.username, {:controller=>'users',:action=>'name',:id=>zhishi.username} %>
				@<span class="time"><%= zhishi.updated_at.to_s %></span>
			</div>
		</div>
		<% end %>
	</div>
</div>

<% if is_logged_in?  %>
	<%= link_to '写新知识', new_zhishi_path %>
<% else %>
	<%= link_to '写新知识', new_user_path %>
<% end %>